package com.jeff.android.lab.jetpack.activity

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Button
import com.jeff.android.lab.BaseActivity
import com.jeff.android.lab.R

/**
 * @author: dingfeng
 * @date: 2021/3/2
 * @since: 1.0.0
 **/
class Activity2 : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.jetpack_1_2_activity)
        val btn = findViewById<Button>(R.id.btn_launch)
        btn.text = "返回"

        findViewById<View>(R.id.btn_launch).setOnClickListener {
            setResult(Activity.RESULT_OK, Intent().putExtra("data", "Welcome back"))
            finish()
        }
    }

}